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

Source tracking - Arc SQL Server creation and register resource provider #26211

Open
wants to merge 7 commits into
base: akshikagupta/dev/source-selection
Choose a base branch
from

Conversation

akshika898
Copy link
Contributor

@akshika898 akshika898 commented Feb 20, 2025

If SQL server is not enabled by Arc:

  • Register resource provider. For unauthorized access, raise warning.
  • If Arc resource exists, raise error.
  • If Arc resource exists in same resource group but other location, raise error.
  • If no Arc resource exists, create a new Arc resource on selected infra.

@akshika898 akshika898 changed the title Akshikagupta/dev/arc resource creation Source tracking - Arc SQL Server creation and register resource provider Feb 20, 2025
@akshika898 akshika898 force-pushed the akshikagupta/dev/arc-resource-creation branch from 471097a to 959b352 Compare February 25, 2025 08:58
const path = encodeURI(`/subscriptions/${subscription.id}/resourceGroups/${resourceGroup.name}/providers/Microsoft.AzureArcData/sqlServerInstances/${sqlServerName}?api-version=${SQL_ARC_API_VERSION}`);
const api = await getAzureCoreAPI();
const host = api.getProviderMetadataForAccount(account).settings.armResource?.endpoint;
const response = await api.makeAzureRestRequest<any>(account, subscription, path, azurecore.HttpRequestMethod.GET, undefined, true, host, getDefaultHeader());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is lot of duplicate code . Refactor code to create a helper function having makeAzureRestRequest and calling it in different methods with params

@akshika898 akshika898 requested a review from JyotikaGargg March 11, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants