Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
377 stars 173 forks source link

Adding apiManagementConfig to connect function/web apps #1403

Closed pamelafox closed 1 year ago

pamelafox commented 1 year ago

Web Apps and Functions both have an "API Management" link in the left sidebar in Azure Portal that can optionally embed a connected API Management instance.

Screenshot of APIM embedded

That link is set by the apiManagementConfig property on the Web/Function app.

This PR adds that configuration to all the samples with a Web/Function App backend. The samples that use Azure Container Apps should not be affected by the change.

I have verified this works on todo-python-mongo-swa-func and will test a few others as well. I am hoping there's an automated build for all the TODO apps once I make a pull request, but that may be wishful thinking. I'll find out soon!

pamelafox commented 1 year ago

Update: I've tested with a function app with and without useApim and also tested an ACA app with and without useApim (where I would expect the setting to get ignored). Things looks good.

jongio commented 1 year ago

LGTM, @rajeshkamal5050 do we want to run automation or manual tests on this?

rajeshkamal5050 commented 1 year ago

@pamelafox you can run the template tests automation pipeline with/without APIM. It should cover for any regressions. https://dev.azure.com/azure-sdk/internal/_build?definitionId=5002

@weikanglim please add if any additional testing needs to be done.

pamelafox commented 1 year ago

@rajeshkamal5050 Thanks, I'm trying to figure out how to trigger that pipeline for my branch, I haven't used ADO pipelines before and am wondering if I'm lacking permissions or just don't know what to click. Here's what I see:

Screenshot 2023-01-19 at 10 16 18 AM

Screenshot 2023-01-19 at 10 17 38 AM

I thought I'd find a manual trigger option in the branches tab, but don't see anything there or in the menu on it. Can you advise?

rajeshkamal5050 commented 1 year ago

/azp run azure-dev - template - tests

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
pamelafox commented 1 year ago

Hm, the "install azd" task failed on that job. The output shows it trying to download from a different URL than previous jobs.

This job: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2128637&view=logs&j=295b8682-616f-500d-bd95-0eb28c188b5c&t=3ae82285-cad6-5d09-a239-e1a494dd79f8

install-azd: Downloading [https://***.blob.core.windows.net/azd/standalone/pr/1403/azd-linux-amd64.tar.gz](https://%2A%2A%2A.blob.core.windows.net/azd/standalone/pr/1403/azd-linux-amd64.tar.gz) to /tmp/tmp.ilQODVfDLa
install-azd: ERROR: Could not download from [https://***.blob.core.windows.net/azd/standalone/pr/1403/azd-linux-amd64.tar.gz,](https://%2A%2A%2A.blob.core.windows.net/azd/standalone/pr/1403/azd-linux-amd64.tar.gz,) ensure platform and architecture are supported

Previous job: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2126583&view=logs&j=5cf76c9a-598b-5efe-8084-d68089812150&t=18eb66fc-b621-5bc1-fbd0-59349a1d5a57

install-azd: Downloading https://azure-dev.azureedge.net/azd/standalone/release/daily/azd-linux-amd64.tar.gz to /tmp/tmp.YQ2hl2Yf2S
azd-linux-amd64
rajeshkamal5050 commented 1 year ago

@danieljurek @weikanglim can you help in running the template test pipelines with/without APIM?

danieljurek commented 1 year ago

/azp run azure-dev - repoman

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
danieljurek commented 1 year ago

We've got two pipeline runs verifying this:

rajeshkamal5050 commented 1 year ago

/azp run azure-dev - repoman

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
weikanglim commented 1 year ago

Running with APIM enabled: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2152232&view=results

Going to quickly verify this before merging.

weikanglim commented 1 year ago

/azp run azure-dev - repoman

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
pamelafox commented 1 year ago

@wbreza Not sure why I had the dependsOn originally, I sometimes put it to be better "safe than sorry" or while working around Bicep issues. However, I just tried removing it from todo-python and it seemed to deploy fine. Hopefully the template tests all pass! Thanks for the help.

weikanglim commented 1 year ago

/azp run azure-dev - repoman

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
azure-sdk commented 1 year ago

Repoman Generation Results

Repoman pushed changes to remotes for the following projects:

Project: todo-csharp-cosmos-sql

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/1403

View Changes | Compare Changes


Project: todo-csharp-sql-swa-func

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/1403

View Changes | Compare Changes


Project: todo-csharp-sql

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-sql -b pr/1403

View Changes | Compare Changes


Project: todo-java-mongo-aca

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-java-mongo-aca -b pr/1403

View Changes | Compare Changes


Project: todo-java-mongo

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-java-mongo -b pr/1403

View Changes | Compare Changes


Project: todo-nodejs-mongo-aca

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/1403

View Changes | Compare Changes


Project: todo-nodejs-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/1403

View Changes | Compare Changes


Project: todo-nodejs-mongo

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo -b pr/1403

View Changes | Compare Changes


Project: todo-python-mongo-aca

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-aca -b pr/1403

View Changes | Compare Changes


Project: todo-python-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/1403

View Changes | Compare Changes


Project: todo-python-mongo

Remote: azure-samples-staging

Branch: pr/1403

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo -b pr/1403

View Changes | Compare Changes