Branch deploy is not working at all

Follow-up coming soon - project about to go-live - so I can summarise all that wasn’t working and got fixed including how. Basically I cannot mark one single reply as a solution :slight_smile:

1 Like

Oh the irony… How to Integrate Azure DevOps with Netlify CI/CD | Netlify Blog (May 24th 2022)

1 Like

Thanks for letting us know! We can’t wait to see your project :rocket:

1 Like

I’ve marked the ultimate solution to this issue further up, but as a summary…

At the time of this post Azure DevOps was not a first class supported integration. Now it is. So first up, check out this recent announcement first (How to Integrate Azure DevOps with Netlify CI/CD | Netlify Blog) and research from there perhaps.

If that still doesn’t help, these were the solutions to my uh… issues;

Branch deploy wasn’t working

  • First I needed to have separate build hooks set up for my main AND staging branches in Azure DevOps / Netlify
  • TIP: If still relevant, I could only add a second build hook to Netlify immediately after a failed deployment occurred. If you see the option and don’t click it when you see it, the option might go away. Was a bit weird and might not be an issue any longer.
  • Pushing to my Main branch in DevOps seemed to trigger both hooks, so I now manually trigger a Production release which - since it’s infrequent - works for me
  • Quadruple check your configuration - or more if needed. I got a missing /dist folder error on my staging build because I followed a tutorial that placed an echo (effectively a console log) where a build command should have been - and I didn’t notice :man_facepalming:
  • Remember the Branch deploy URLs follow a specific format: <branch-name>--<subdomain>.netlify.app

Enabling CORs per endpoint in .NET Core Web API

  • It’s possible but do your research first.
  • I ended up having two policies (public and private) where I specified the origins and specifically supported methods for each (even if it was all of them).
  • The order and use of app.method calls to enable per-endpoint CORs was;
app.UseRouting();
app.UseCors();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
	endpoints.MapControllers();
});
1 Like

Hi @JeremyW, I’m sorry you had to go through all this trouble to get things working before we introduced support for Azure DevOps as a Git provider! I wanted to take a minute to appreciate that you shared your findings with the community regardless; always awesome to have folks sharing their knowledge. Thank you and we’re happy to hear any feedback you might have about the new integration!

1 Like