0

Has anyone deployed a function apps with a self-hosted agent? looks like the ADO tasks all require a service connection.

- task: AzureFunctionApp@2
 inputs:
 connectedServiceNameARM: # string. Alias: azureSubscription. **Required**

We have a hub-spoke architecture with a ton of security and have the agents deployed to each hub, that's how we currently deploy.

Also can't create a service connection to our government subs.

bryanbcook
19.7k3 gold badges49 silver badges80 bronze badges
asked Jun 4, 2025 at 18:58

1 Answer 1

0

Whether you're using a self-hosted agent or Microsoft provided cloud agent, you'll need credentials in the Azure Subscription. You're going to need a service principal of some kind.

Service Connections are the preferred and fundamental concept for securely abstracting away endpoint and credential details from the pipeline authors. The vast majority of tasks in the azure devops marketplace are engineered with this concept and require a service connection. Service Connections also offer additional levels of security in that each pipeline must be authorized by the service connection owner, and approvals and checks can be applied to regulate their use with approvals, business hours, etc. Service Connections also support workload identity federation (oidc) so there are no application secrets that need to be recycled.

Assuming your hub-and-spoke model uses separate subscriptions for the spokes and a common AD tenant in the hub, you can either:

  • create a single identity (service principal) and grant it the necessary credentials to each subscription. Create one service connection that targets the Management Group (instead of the subscription); or
  • create an identity per subscription with the appropriate credentials. Create a service-connection per identity.

Azure DevOps supports service connections that target Azure Government.

If you don't have the authority to create the service principal, the service principals can be created by an admin and then manually configured within Azure DevOps.

answered Jun 4, 2025 at 22:08
Sign up to request clarification or add additional context in comments.

2 Comments

that's exactly what we have, one tenant and subs for each client with their own mi's, for their hub and each spoke(s). further investigation, looks like our ADO is setup to connect to our non gov azure, and its not letting me add the gov. so when i try to create a service connection it is only listing our non azure sub/resources
understood. your EntraID for your ADO environment is not the same tenant that is associated with your Subscriptions. When creating a service principal via the service connection UI the "(automatic)" option requires the same tenant. You can create the service principals manually in Entra and then use the "(manual)" option in the UI. You'll need to provide the subscription id and other details when setting it up.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.