Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating project: creating service backend: expecting only '1' resource tagged with 'azd-service-name: backend', but found '2'. Ensure a unique service resource is correctly tagged in your bicep files, and rerun provision tags: union(tags, { 'azd-service-name': 'backend' }) #154

Open
Gaigaisun opened this issue Apr 27, 2023 · 12 comments
Labels

Comments

@Gaigaisun
Copy link

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Error: creating project: creating service backend: expecting only '1' resource tagged with 'azd-service-name: backend', but found '2'. Ensure a unique service resource is correctly tagged in your bicep files, and rerun provision
tags: union(tags, { 'azd-service-name': 'backend' })

Expected/desired behavior

I have deployed successfully the demo and I would like to know can we use this demo to deploy one more application with same resources except diffrent of search index appServicePlanName,backendServiceName,searchIndexName and AZURE_ENV_NAME

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

@wantanej
Copy link

I also faced the same issue.
Pls tell me how to deploy backend more than 1?
where else should I change the tag name? (I already changed in main.bicep)

@zhongshuai-cao
Copy link

Same issue here, changing the main.bicep doesn't help, and cannot find any other settings about the tag

@marceloricciardi
Copy link

@zhongshuai-cao @wantanej Did you manage to solve this problem? I am stuck on it here too.

@wantanej
Copy link

image

I tried to change Line No. 7 in azure.yaml
It worked for me.

@pamelafox
Copy link
Collaborator

Hi all! The "backend" service name in azure.yaml must match the tags in infra/ folder.

If you are trying to deploy two backends to the same resource group, then yes, I think you could update both azure.yaml as well as main.bicep:

tags: union(tags, { 'azd-service-name': 'backend' })

cc @jongio in case there's a better way to do this that I'm forgetting.

@jongio
Copy link
Member

jongio commented Jul 12, 2023

Can you add more details on what you are trying to accomplish? A description of your scenario would help me make a recommendation

@preslavsh
Copy link

If want to have two different environment dev and prod for example.

@suma-sai-paluri
Copy link

I tried deploying the same idea : different app service plan, different app service, different index and a different environment name in the pre existing resource group which contains another app which is deployed using the same repo. The following are the changes I made :

  1. In azure.yaml file:
    On line 7 I have changed the name from "backend" to "backendtest"
    2)In main.bicep file:
    I have made a change in the module backend section, I made the following change to the tags attribute.
    tags: union(tags, { 'azd-service-name': 'backendtest' })
    And used azd up to provision and deploy.
    Hoping it might help some one , Have a good day =)

@zhongshuai-cao
Copy link

I've been manually adjusting the backend name to deploy multiple instances within the same resource group. I'm unsure if this approach is recommended.

I suggest making the service name configurable through an environment variable named BACKEND_SERVICE_NAME to enhance deployment versatility. Additionally, I'm looking for a method to configure the key in the .yml file. To my knowledge, only the value can be modified, not the key itself in a .yml. Any guidance on this would be appreciated.

@zhongshuai-cao
Copy link

zhongshuai-cao commented Oct 4, 2023

Hi all! The "backend" service name in azure.yaml must match the tags in infra/ folder.

If you are trying to deploy two backends to the same resource group, then yes, I think you could update both azure.yaml as well as main.bicep:

tags: union(tags, { 'azd-service-name': 'backend' })

cc @jongio in case there's a better way to do this that I'm forgetting.

It will be great if it is configurable with environment variable, like BACKEND_SERVICE_NAME, in my last comment #154 (comment)

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.

@github-actions github-actions bot added the Stale label Dec 28, 2023
@ardab
Copy link

ardab commented Apr 9, 2024

I've been manually adjusting the backend name to deploy multiple instances within the same resource group. I'm unsure if this approach is recommended.

I suggest making the service name configurable through an environment variable named BACKEND_SERVICE_NAME to enhance deployment versatility. Additionally, I'm looking for a method to configure the key in the .yml file. To my knowledge, only the value can be modified, not the key itself in a .yml. Any guidance on this would be appreciated.

UP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants