Publishing an app that relies on multiple projects with differnet provisional profiles.

Dave Mkheyan 20 Reputation points
2025-04-11T18:04:37.95+00:00

We are having an issue with our app. The app contains 2 projects, one of them is the main app, the other one is the notification project, which use different provisional profiles. In the Appcenter, building the app with different provisional profiles for each project worked, but it doesn't work with the Azure Pipeline configuration, as the dotnet publish gives an error.

Here is the yaml used.

variables:
  - group: variables    

stages:
- stage: BuildiOS
  jobs:
  - job: BuildMAUIApps
    displayName: Check vm image
    pool:
      vmImage: 'macOS-15'
      demands:
      - MSBuild

    steps:


    - script: |
          echo Mac OS version:
          sw_vers -productVersion
          echo
          echo Installed Xcode versions:
          ls /Applications | grep 'Xcode'
          echo
          echo currently selected xcode:
          xcrun xcode-select --print-path
          echo
          echo selecting latest xcode...
          sudo xcode-select -s /Applications/Xcode_16.2.app
          sudo xcode-select -switch /Applications/Xcode_16.2.app/Contents/Developer
          xcrun xcode-select --print-path
          xcodebuild -version
      displayName: 'Select Xcode Version'

    # https://docs.microsoft.com/en-us/azure/devops/pipelines/apps/mobile/app-signing?view=azure-devops&tabs=apple-install-during-build#sign-your-apple-ios-macos-tvos-or-watchos-app
    # Setup Secret Pipeline Variable or Library Secrets Variable for iOS Certificate Password
    - task: InstallAppleCertificate@2
      inputs:
        certSecureFile: 'QuarterSystemProductionCert.p12'
        certPwd: '$(certPassword)'
        keychain: 'temp'

- 
  
  
    
    
- 
  
  
    
    
- 
  
  
  

    - bash: |
        echo "APPLE_CERTIFICATE_SIGNING_IDENTITY is $(APPLE_CERTIFICATE_SIGNING_IDENTITY)"
        echo "APPLE_PROV_PROFILE_UUID is $(APPLE_PROV_PROFILE_UUID)"
      displayName: Check profile

    - task: UseDotNet@2
      displayName: .NET Version
      inputs:
        packageType: 'sdk'
        version: '9.0.101'

    - task: Bash@3
      displayName: Install MAUI
      inputs:
        targetType: 'inline'
        script: |
          dotnet nuget locals all --clear
          dotnet workload install maui --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json --source https://api.nuget.org/v3/index.json
          dotnet workload install android ios maui --version 9.0.101.2 --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json --source https://api.nuget.org/v3/index.json

    - task: Bash@3
      displayName: Restore nuget
      inputs:
        targetType: 'inline'
        script: |          
          dotnet restore KYChat.sln

  # https://docs.microsoft.com/en-us/dotnet/maui/ios/deployment/overview
    - task: Bash@3
      displayName: Build iOS Legit App
      inputs:
        targetType: 'inline'
        script: |
          cd KYChat.Maui/KYChat.Maui.iOS
          dotnet publish -f net8.0-ios -c Release /p:CodesignKey='$(APPLE_CERTIFICATE_SIGNING_IDENTITY)' /p:CodesignProvision='$(APPLE_PROV_PROFILE_UUID)'
    
     # publish artifacts(.ipa file) to firebase distribution
     # install firebase tools
    - task: CmdLine@2
      displayName: Install firebase tools
      inputs:
       script: 'curl -sL https://firebase.tools | bash'
    - task: DownloadSecureFile@1
      displayName: Download the secure file for firebase
      inputs:
       secureFile: 'legit_ios_firebase.json'
    - task: CmdLine@2
      displayName: Upload/publish artifact to firebase
      inputs:
       script: |
         export GOOGLE_APPLICATION_CREDENTIALS=$(Agent.TempDirectory)/legit_ios_firebase.json
         firebase appdistribution:distribute "$(Build.ArtifactStagingDirectory)/KYChat.Maui.iOS.ipa" --app '$(iOS_FirebaseAppId)' --release-notes " Branch: $(Build.SourceBranchName) \n Build version: $(Build.BuildNumber)" --groups "OnlyMe"  
   

And the error message I get is

/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/tools/msbuild/iOS/Xamarin.Shared.targets(1835,3): error : Project bundle identifier 'app.utilla.legit.sharing' does not match specified provisioning profile 'c0f201b5-f63f-4d7a-b05a-1f8d77440313' [/Users/runner/work/1/s/Sharing/ShareExtNative/ShareExt.NET.iOS.csproj] /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/tools/msbuild/iOS/Xamarin.Shared.targets(1835,3): error : [/Users/runner/work/1/s/Sharing/ShareExtNative/ShareExt.NET.iOS.csproj]

Azure DevOps
{count} votes

Accepted answer
  1. Suresh Chikkam 1,180 Reputation points Microsoft External Staff
    2025-04-14T10:22:29.6333333+00:00

    Hi Dave Mkheyan,

    Here you need to specify separate provisioning profiles for each target, especially for the extension (ShareExt.NET.iOS.csproj).

    To fix this, pass target-specific provisioning profile UUIDs using dotnet publish with CodesignProvision and CodesignKey properties per project.

    Get UUIDs of both provisioning profiles:

    • One for the main app (KYChat.Maui.iOS)
    • One for the notification extension (ShareExt.NET.iOS)

    Here is the YAML file split into two publish steps:

        - task: Bash@3
          displayName: Build iOS Legit App
          inputs:
            targetType: 'inline'
            script: |
              cd KYChat.Maui/KYChat.Maui.iOS
              dotnet publish -f net8.0-ios -c Release \
                /p:CodesignKey='$(MAIN_APP_SIGNING_ID)' \
                /p:CodesignProvision='$(MAIN_APP_PROV_UUID)'
        - task: Bash@3
          displayName: Build Notification Extension
          inputs:
            targetType: 'inline'
            script: |
              cd ../../Sharing/ShareExtNative
              dotnet publish -f net8.0-ios -c Release \
                /p:CodesignKey='$(EXT_SIGNING_ID)' \
                /p:CodesignProvision='$(EXT_PROV_UUID)'
    

    Also, define the variables:

    • MAIN_APP_SIGNING_ID
    • MAIN_APP_PROV_UUID
    • EXT_SIGNING_ID
    • EXT_PROV_UUID

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.

    User's image

    If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Dave Mkheyan 20 Reputation points
    2025-04-17T08:31:14.51+00:00

    Actually what worked for us is having individual variables set for each project for the parameters, and passing them in the command line.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.