My application is basically a gamified social media site…
My front end is an angular application that is trying to ping a C# back end.
I have a microsoft sql server that I am using and managing via Dbeaver
I am using all azure services to connect the whole application.
I created/populated the DB, Migrated it with EFCore, and made sure all the controllers and everything are working.I can run the back end and ping the api and get accurate responses with multiple methods, so I know that the DB is working at least. The local API works via swagger. I cannot seem to pinpoint what the disconnect is between my front and back end.
I used dotnet user-secret set and created a user secret with the connection string in it.
builder.Configuration.AddUserSecrets<Program>();
var cs = builder.Configuration.GetConnectionString("Usr");
builder.Services.AddDbContext<CosminisOfficialDBContext>(options => options.UseSqlServer(cs));
I added a guid to the property group for the user secret so the environment should have it
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>USER_GUID</UserSecretsId>
</PropertyGroup>
I don’t think it is even my code (yet) though… I don’t think it gets that far.
When I click the URL on my azure web app, it just gives a 400 even though all my code should be working at least on the back end. I am not sure what it could be and I have just been at this and making no progress. Can anyone think of what I might be missing?
Also relevant:
When I look at my application logs when I try to make simple requests to just the API itself, my logger spits out a bunch of html and it says this:
My actual API name should be APP_NAME-Ithinkmysubscribercode.eastus-01.azurewebsites.net/
but then the log says APP_NAME:80 and it doesn’t have the subscriber code or eastus-01.azurewebsites.net part…. Why would it be requesting it from a totally different URL? I am also using port 1433 and not port 80 anywhere.
400 | Bad Request |
---|---|
Requested URL | https://APP_NAME:80/companions/GetAll |
Physical Path | C:homesitewwwrootcompanionsGetAllRequested |
URL | https://APP_NAME:80/companions/GetAll |
Physical Path | C:homesitewwwrootcompanionsGetAll |
I have been trying everything I can think of including azure tools to figure out where there is a disconnect. I used AI and asked friends and have been looking things up online constantly for like 3 days now….