{
    "api_version": "1",
    "kind": "dse_post",
    "self": "https://update.dsesecurity.com/api/v1/posts/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/",
    "item": {
        "id": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/",
        "slug": "dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source",
        "url": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/",
        "alternate_urls": {
            "markdown": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source.md",
            "json": "https://update.dsesecurity.com/api/v1/posts/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/"
        },
        "title": "Calculate the upload byte count from the right managed-disk source",
        "summary": "Why does a direct-copy target need a different size calculation from a local VHD upload?",
        "format": {
            "slug": "guide",
            "name": "Guide"
        },
        "priority": {
            "slug": "info",
            "name": "Information"
        },
        "featured": false,
        "image": {
            "theme": "continuity-recovery",
            "label": "Continuity & recovery",
            "alt": "Paired infrastructure paths converging on a stable recovered service.",
            "card_url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-card.webp?v=1.8.20",
            "hero_url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-hero.webp?v=1.8.20",
            "social_url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-social-v2.jpg?v=1.8.20",
            "width": 2400,
            "height": 1350
        },
        "topics": [
            {
                "slug": "business-continuity",
                "name": "Business Continuity",
                "url": "https://update.dsesecurity.com/topic/business-continuity/"
            },
            {
                "slug": "it",
                "name": "IT",
                "url": "https://update.dsesecurity.com/topic/it/"
            }
        ],
        "author": {
            "name": "DSE Security Editorial Team",
            "url": "https://update.dsesecurity.com/#editorial-team",
            "type": "Organization"
        },
        "publisher": {
            "name": "Detection Systems & Engineering",
            "url": "https://dsesecurity.com/"
        },
        "published_at": "2026-09-10T00:24:41+00:00",
        "modified_at": "2026-09-10T02:04:57+00:00",
        "reviewed_on": "2026-09-09",
        "reading_minutes": 2,
        "word_count": 243,
        "potentially_affected": "Operators preparing Azure managed-disk copies with the documented PowerShell direct-upload workflow.",
        "dse_recommendation": "Record whether the size input came from a local file or an Azure managed-disk resource.",
        "primary_source": {
            "name": "Upload a VHD to Azure or copy a disk across regions - Azure PowerShell - Azure Virtual Machines | Microsoft Learn",
            "url": "https://learn.microsoft.com/en-us/azure/virtual-machines/windows/disks-upload-vhd-to-managed-disk-powershell",
            "published_on": null,
            "authority": "Microsoft Learn"
        },
        "publishing_principles": "https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/",
        "usage_info": "https://update.dsesecurity.com/usage/",
        "copyright_notice": "Copyright © 2026 Detection Systems & Engineering. All rights reserved.",
        "content_html": "<h2>Source facts</h2>\n<p>For a local VHD upload, Microsoft&#8217;s PowerShell workflow takes the file&#8217;s length in bytes for UploadSizeInBytes. When copying an existing Azure managed disk, its reported byte count omits the footer, so the destination calculation must add 512 bytes; otherwise the copy fails. For an OS disk, the destination configuration must also specify the appropriate Hyper-V generation. Finishing data transfer alone does not make the upload disk attachable: its SAS must be revoked. <a href=\"https://learn.microsoft.com/en-us/azure/virtual-machines/windows/disks-upload-vhd-to-managed-disk-powershell\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Learn</a>.</p>\n<h2>Applicability</h2>\n<p>Apply this distinction when adapting a direct-upload script into a region-copy or recovery workflow. Review the origin of every size value and the intended OS-disk generation before creating a target resource.</p>\n<h2>DSE recommendation</h2>\n<p>Record whether the size input came from a local file or an Azure managed-disk resource. Have the operator annotate the size calculation with its source and units. Keep local-file and managed-resource paths explicit in automation, and compare the resulting request with the corresponding official example. Do not repair a failed copy by repeatedly changing capacity without explaining the discrepancy.</p>\n<h2>Verification</h2>\n<p>Use a disposable representative disk to check the calculated upload size, destination generation when relevant, and transfer result. Complete the documented access-revocation step before checking attachment in an authorized test VM. Preserve the source resource ID, calculated byte count, and sanitized result without recording the SAS. Resolve unexplained size differences before using the workflow for recovery.</p>\n<h2>Official references</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/azure/virtual-machines/windows/disks-upload-vhd-to-managed-disk-powershell\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Learn: Upload a VHD or copy a managed disk with Azure PowerShell</a>. Source reviewed September 9, 2026.</p>",
        "content_text": "Source facts\nFor a local VHD upload, Microsoft’s PowerShell workflow takes the file’s length in bytes for UploadSizeInBytes. When copying an existing Azure managed disk, its reported byte count omits the footer, so the destination calculation must add 512 bytes; otherwise the copy fails. For an OS disk, the destination configuration must also specify the appropriate Hyper-V generation. Finishing data transfer alone does not make the upload disk attachable: its SAS must be revoked. Microsoft Learn.\nApplicability\nApply this distinction when adapting a direct-upload script into a region-copy or recovery workflow. Review the origin of every size value and the intended OS-disk generation before creating a target resource.\nDSE recommendation\nRecord whether the size input came from a local file or an Azure managed-disk resource. Have the operator annotate the size calculation with its source and units. Keep local-file and managed-resource paths explicit in automation, and compare the resulting request with the corresponding official example. Do not repair a failed copy by repeatedly changing capacity without explaining the discrepancy.\nVerification\nUse a disposable representative disk to check the calculated upload size, destination generation when relevant, and transfer result. Complete the documented access-revocation step before checking attachment in an authorized test VM. Preserve the source resource ID, calculated byte count, and sanitized result without recording the SAS. Resolve unexplained size differences before using the workflow for recovery.\nOfficial references\nMicrosoft Learn: Upload a VHD or copy a managed disk with Azure PowerShell. Source reviewed September 9, 2026.",
        "content_markdown": "## Source facts\n\nFor a local VHD upload, Microsoft’s PowerShell workflow takes the file’s length in bytes for UploadSizeInBytes. When copying an existing Azure managed disk, its reported byte count omits the footer, so the destination calculation must add 512 bytes; otherwise the copy fails. For an OS disk, the destination configuration must also specify the appropriate Hyper-V generation. Finishing data transfer alone does not make the upload disk attachable: its SAS must be revoked. [Microsoft Learn](https://learn.microsoft.com/en-us/azure/virtual-machines/windows/disks-upload-vhd-to-managed-disk-powershell).\n\n## Applicability\n\nApply this distinction when adapting a direct-upload script into a region-copy or recovery workflow. Review the origin of every size value and the intended OS-disk generation before creating a target resource.\n\n## DSE recommendation\n\nRecord whether the size input came from a local file or an Azure managed-disk resource. Have the operator annotate the size calculation with its source and units. Keep local-file and managed-resource paths explicit in automation, and compare the resulting request with the corresponding official example. Do not repair a failed copy by repeatedly changing capacity without explaining the discrepancy.\n\n## Verification\n\nUse a disposable representative disk to check the calculated upload size, destination generation when relevant, and transfer result. Complete the documented access-revocation step before checking attachment in an authorized test VM. Preserve the source resource ID, calculated byte count, and sanitized result without recording the SAS. Resolve unexplained size differences before using the workflow for recovery.\n\n## Official references\n\n[Microsoft Learn: Upload a VHD or copy a managed disk with Azure PowerShell](https://learn.microsoft.com/en-us/azure/virtual-machines/windows/disks-upload-vhd-to-managed-disk-powershell). Source reviewed September 9, 2026."
    },
    "json_ld": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://dsesecurity.com/#organization",
                "name": "Detection Systems & Engineering",
                "alternateName": "DSE Security",
                "url": "https://dsesecurity.com/",
                "logo": {
                    "@type": "ImageObject",
                    "url": "https://update.dsesecurity.com/assets/dse-logo-20260812.png?v=1.8.20"
                }
            },
            {
                "@type": "Organization",
                "@id": "https://update.dsesecurity.com/#editorial-team",
                "name": "DSE Security Editorial Team",
                "url": "https://update.dsesecurity.com/",
                "parentOrganization": {
                    "@id": "https://dsesecurity.com/#organization"
                }
            },
            {
                "@type": "WebSite",
                "@id": "https://update.dsesecurity.com/#website",
                "name": "DSE Updates",
                "alternateName": "DSE Security Knowledge Hub",
                "url": "https://update.dsesecurity.com/",
                "inLanguage": "en-US",
                "publisher": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "potentialAction": {
                    "@type": "SearchAction",
                    "target": {
                        "@type": "EntryPoint",
                        "urlTemplate": "https://update.dsesecurity.com/?q={search_term_string}"
                    },
                    "query-input": "required name=search_term_string"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/",
                "url": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/",
                "isPartOf": {
                    "@id": "https://update.dsesecurity.com/#website"
                },
                "lastReviewed": "2026-09-09"
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/#breadcrumbs",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "DSE Updates",
                        "item": "https://update.dsesecurity.com/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Calculate the upload byte count from the right managed-disk source",
                        "item": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/"
                    }
                ]
            },
            {
                "@type": [
                    "Article",
                    "TechArticle"
                ],
                "@id": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/#article",
                "identifier": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/",
                "url": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/",
                "headline": "Calculate the upload byte count from the right managed-disk source",
                "description": "Why does a direct-copy target need a different size calculation from a local VHD upload?",
                "abstract": "Why does a direct-copy target need a different size calculation from a local VHD upload?",
                "articleBody": "Source facts\nFor a local VHD upload, Microsoft’s PowerShell workflow takes the file’s length in bytes for UploadSizeInBytes. When copying an existing Azure managed disk, its reported byte count omits the footer, so the destination calculation must add 512 bytes; otherwise the copy fails. For an OS disk, the destination configuration must also specify the appropriate Hyper-V generation. Finishing data transfer alone does not make the upload disk attachable: its SAS must be revoked. Microsoft Learn.\nApplicability\nApply this distinction when adapting a direct-upload script into a region-copy or recovery workflow. Review the origin of every size value and the intended OS-disk generation before creating a target resource.\nDSE recommendation\nRecord whether the size input came from a local file or an Azure managed-disk resource. Have the operator annotate the size calculation with its source and units. Keep local-file and managed-resource paths explicit in automation, and compare the resulting request with the corresponding official example. Do not repair a failed copy by repeatedly changing capacity without explaining the discrepancy.\nVerification\nUse a disposable representative disk to check the calculated upload size, destination generation when relevant, and transfer result. Complete the documented access-revocation step before checking attachment in an authorized test VM. Preserve the source resource ID, calculated byte count, and sanitized result without recording the SAS. Resolve unexplained size differences before using the workflow for recovery.\nOfficial references\nMicrosoft Learn: Upload a VHD or copy a managed disk with Azure PowerShell. Source reviewed September 9, 2026.",
                "datePublished": "2026-09-10T00:24:41+00:00",
                "dateModified": "2026-09-10T02:04:57+00:00",
                "mainEntityOfPage": {
                    "@id": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/"
                },
                "inLanguage": "en-US",
                "isAccessibleForFree": true,
                "author": {
                    "@type": "Organization",
                    "name": "DSE Security Editorial Team",
                    "url": "https://update.dsesecurity.com/#editorial-team"
                },
                "publisher": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "image": {
                    "@type": "ImageObject",
                    "@id": "https://update.dsesecurity.com/updates/dse-20260909-435-calculate-the-upload-byte-count-from-the-right-managed-disk-source/#primaryimage",
                    "url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-social-v2.jpg?v=1.8.20",
                    "contentUrl": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-social-v2.jpg?v=1.8.20",
                    "width": 1200,
                    "height": 630,
                    "caption": "Calculate the upload byte count from the right managed-disk source"
                },
                "articleSection": [
                    "Business Continuity",
                    "IT"
                ],
                "keywords": [
                    "Business Continuity",
                    "IT",
                    "Guide",
                    "Information priority"
                ],
                "genre": "Guide",
                "about": [
                    {
                        "@type": "Thing",
                        "name": "Business Continuity",
                        "url": "https://update.dsesecurity.com/topic/business-continuity/"
                    },
                    {
                        "@type": "Thing",
                        "name": "IT",
                        "url": "https://update.dsesecurity.com/topic/it/"
                    }
                ],
                "wordCount": 243,
                "timeRequired": "PT2M",
                "publishingPrinciples": "https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/",
                "usageInfo": "https://update.dsesecurity.com/usage/",
                "copyrightHolder": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "copyrightNotice": "Copyright © 2026 Detection Systems & Engineering. All rights reserved.",
                "citation": {
                    "@type": "CreativeWork",
                    "name": "Upload a VHD to Azure or copy a disk across regions - Azure PowerShell - Azure Virtual Machines | Microsoft Learn",
                    "url": "https://learn.microsoft.com/en-us/azure/virtual-machines/windows/disks-upload-vhd-to-managed-disk-powershell"
                }
            }
        ]
    }
}