import React from 'react'; import { Radio, Content, Form, Title, FormGroup, TextInput, Gallery, GalleryItem, Button, } from '@patternfly/react-core'; import { ExternalLinkAltIcon } from '@patternfly/react-icons'; import { AzureAuthButton } from './AzureAuthButton'; import { AzureHyperVSelect } from './AzureHyperVSelect'; import { AzureResourceGroups } from './AzureResourceGroups'; import { AzureSourcesSelect } from './AzureSourcesSelect'; import { AZURE_AUTH_URL } from '../../../../../constants'; import { useAppDispatch, useAppSelector } from '../../../../../store/hooks'; import { changeAzureResourceGroup, changeAzureShareMethod, changeAzureSource, changeAzureSubscriptionId, changeAzureTenantId, selectAzureResourceGroup, selectAzureShareMethod, selectAzureSubscriptionId, selectAzureTenantId, } from '../../../../../store/wizardSlice'; import { ValidatedInput } from '../../../ValidatedInput'; import { isAzureResourceGroupValid, isAzureSubscriptionIdValid, isAzureTenantGUIDValid, } from '../../../validators'; export type AzureShareMethod = 'manual' | 'sources'; const SourcesButton = () => { return ( ); }; const Azure = () => { const dispatch = useAppDispatch(); const shareMethod = useAppSelector(selectAzureShareMethod); const tenantId = useAppSelector(selectAzureTenantId); const subscriptionId = useAppSelector(selectAzureSubscriptionId); const resourceGroup = useAppSelector(selectAzureResourceGroup); return (
Target environment - Microsoft Azure Upon build, Image Builder sends the image to the selected authorized Azure account. The image will be uploaded to the resource group in the subscription you specify. To authorize Image Builder to push images to Microsoft Azure, the account owner must configure Image Builder as an authorized application for a specific tenant ID and give it the role of "Contributor" for the resource group you want to upload to. This applies even when defining target by Source selection.
{ dispatch(changeAzureSource('')); dispatch(changeAzureTenantId('')); dispatch(changeAzureSubscriptionId('')); dispatch(changeAzureShareMethod('sources')); dispatch(changeAzureResourceGroup('')); }} autoFocus /> { dispatch(changeAzureSource('')); dispatch(changeAzureTenantId('')); dispatch(changeAzureSubscriptionId('')); dispatch(changeAzureShareMethod('manual')); dispatch(changeAzureResourceGroup('')); }} /> {shareMethod === 'sources' && ( <> )} {shareMethod === 'manual' && ( <> dispatch(changeAzureTenantId(value))} helperText="Please enter a valid tenant ID" /> dispatch(changeAzureSubscriptionId(value)) } helperText="Please enter a valid subscription ID" /> dispatch(changeAzureResourceGroup(value)) } helperText="Resource group names only allow alphanumeric characters, periods, underscores, hyphens, and parenthesis and cannot end in a period" /> )} ); }; export default Azure;